package com.yc.http.v1.impl;

import com.yc.http.v1.HttpServletImpl;
import com.yc.http.v1.HttpServletRequest;
import com.yc.http.v1.HttpServletResponse;
import com.yc.http.v1.ServletException;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/Logout.s")
public class LogoutServlet extends HttpServletImpl {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
      request.getSession().invalidate();
      response.sendRedirect("/index");
    }
}
